package com.cafuc.discipline.controller;

import com.cafuc.discipline.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Mete
 * @createTime 2023/3/15 10:34
 * @description
 */
@RestController
@Api(tags = "文件相关接口")
public class FileController {
    //上传附件
    @Resource
    FileService fileService;
    @ApiOperation("文件上传接口")
    @PostMapping("/cafuc/file/updata")
    public Object UpData_File(HttpServletRequest request, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws Exception {
        return fileService.UploadFile(request,response,file);
    }
}
